project(Applications)
message(STATUS "Robocar Applications")
include_directories(${RC_CLIENT_INCLUDE_DIR})
include_directories(${RC_CLIENT_INCLUDE_DIR}/../common)
include_directories(${PROJECT_BINARY_DIR})
include_directories(${RC_CLIENT_INCLUDE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/../3rdparty/pistache/include)
include_directories(${PROJECT_SOURCE_DIR}/../3rdparty/libserv/src/include)
if (${WITH_LIBREALSENCE2} STREQUAL "ON")
    add_definitions(-D WITH_LIBREALSENCE2)
endif ()
foreach (ROBOCAR_APPLICATION ${ROBOCAR_APPLICATION_NAME})
    message(STATUS "ROBOCAR_APPLICATION:${ROBOCAR_APPLICATION}")
    #同理，查找当前文件夹中所有的头文件
    file(GLOB APPLICATION_HEAD_FILES "${ROBOCAR_APPLICATION_DIR}/${ROBOCAR_APPLICATION}/include/*.h")
    include_directories(${ROBOCAR_APPLICATION_DIR}/${ROBOCAR_APPLICATION}/include)
    #查找当前文件夹中的所有源代码文件，也可以通过Set命令将所有文件设置为一个变量
    file(GLOB APPLICATION_SRC_FILES "${ROBOCAR_APPLICATION_DIR}/${ROBOCAR_APPLICATION}/src/*.cpp")

    add_executable(${ROBOCAR_APPLICATION}
            ${APPLICATION_SRC_FILES}
            ${APPLICATION_HEAD_FILES}
            )

    target_link_libraries(${ROBOCAR_APPLICATION}
            rccore
            ${ROBOCAR_THIRD_LIBS}
            gflags
            )
endforeach ()
